═══ 1. Title page ═══ 32 bits Linux ext2 file system driver for OS/2 EXT2-OS2 VERSION 2.40 Copyright (C) Matthieu WILLM 1995, 1996, 1997 (willm@ibm.net) ═══ 2. Introduction ═══ ext2-os2 is a file system driver that allows OS/2 to seamlessly access Linux native partitions (ext2fs partitions) in both read and write modes. Once installed, Linux partitions appear as standard OS/2 drive letters. My initial purpose was to get limited read only access to ext2fs partitions from my OS/2 system, so at the beginning (version 0.1 alpha back in June 1995), it was more a quick and dirty rewrite than a clean and full port of the Linux ext2fs file system kernel code. I've improved it to reuse as much original ext2fs code as possible in order to get an almost full featured ext2fs driver on OS/2. I wrote a kind of IFS to VFS translation layer, and ported some Linux kernel services in order to minimize the changes required into the ext2fs sources. Now that ext2-os2 is 32 bits, these changes are minimal. This version is almost full featured : the main restriction is that ext2-os2 does not support extended attributes (EAS). Here are the main features of ext2-os2 :  full 32bits ring 0 implementation  allows read-write access to Linux ext2 partitions  allows OS/2 to swap on Linux ext2 partitions  allows OS/2 to boot from a Linux ext2 partition  supports huge cache sizes  contains a port of most of the Linux ext2 file system utilities from the e2fsprogs-1.10 package : - mke2fs, to format drives as Linux ext2 - e2fsck, to check and repair Linux ext2 file systems - tune2fs, to change Linux ext2 file systems parameters - debugfs, an interactive Linux ext2 file system debugger - lsattr and chattr, to see or change attributes of files on Linux ext2 file systems  can reorder all hard disk drive letters, to avoid partition headaches  hard links are supported under OS/2 and can also be created from OS/2 DISCLAIMER : THE FACT THAT I WORK FOR IBM HAS NOTHING TO DO WITH THIS DRIVER. I'M WRITING IT AT HOME, DURING MY SPARE TIME, FOR MY OWN PURPOSES, ON MY OWN MACHINE, WITHOUT ANY IBM MEANS. I USED ONLY IBM PUBLISHED DOCUMENTS TO WRITE IT : I AM ABSOLUTELY NOT RELATED TO THE OS/2 DEVELOPMENT TEAM AND THUS I HAVE ABSOLUTELY NO ACCESS TO ANY CONFIDENTIAL OS/2 IFS RELATED INFORMATION. Anyway I hope you'll enjoy trying this driver, and even if I don't have much time, I'll try to keep improving it. I wait for your feedback on this version : comments, ideas, bug reports and contributions are welcome. Success stories do also interest me, and disasters too ! Matthieu WILLM willm@ibm.net Home mwillm@vnet.ibm.com Work Note: English is not my native language (I'm french) ... so this document isn't certainly perfect. ═══ 3. *** IMPORTANT WARNING - READ THIS FIRST *** ═══ ext2-os2 is a FILE SYSTEM DRIVER. Being a driver it runs at the most privileged level of the OS/2 operating system, known as "kernel mode". IN KERNEL MODE THERE IS NO MORE CRASH PROTECTION. It means that if a bug occurs in the driver IT CAN CAUSE A HANG OR A SYSTEM HALT, AND THUS CAN CAUSE LOSS OF DATA.  I STRONGLY SUGGEST YOU TO MAKE A BACKUP OF ALL YOUR DATA (EVEN IF THEY ARE NOT LOCATED ON A LINUX PARTITION) PRIOR TO USE THIS DRIVER.  DON'T USE THIS DRIVER ON A PRODUCTION MACHINE, OR IF YOU MANIPULATE CRITICAL DATA.  IF HUMAN LIFE DEPENDS ON YOUR SYSTEM, DON'T INSTALL THIS DRIVER ON IT.  USE IT AT YOUR OWN RISKS, AND ONLY ON A MACHINE YOU ACCEPT TO CRASH AND REINSTALL.  BE AWARE THAT THIS DRIVER WILL GIVE FULL UNRESTRICTED (ROOT) ACCESS TO ALL YOUR EXT2FS PARTITIONS FROM OS/2. From experience, ext2-os2 is now stable for normal use, and it is unlikely that a disaster will occur. But as any piece of software, it cannot be bulletproof. Doing regular backups is still the best method to protect against disasters of any kinds ... ═══ 4. Copyright information ═══ Copyright notice for the ext2fs IFS driver Copyright notice for the ext2fs partition filter Authors of the original Linux ext2 file system ═══ 4.1. Copyright notice for the ext2fs IFS driver ═══ 32 bits Linux ext2fs file system driver for OS/2 WARP - Allows OS/2 to access your Linux ext2fs partitions as normal drive letters. Copyright (C) 1995, 1996, 1997 Matthieu WILLM This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ═══ 4.2. Copyright notice for the ext2fs partition filter ═══ /************************************************************************/ /* Linux partition filter. */ /* (C) Copyright Deon van der Westhuysen, July 1995. */ /* */ /* Dedicated to Jesus Christ, my Lord and Saviour. */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2, or (at your option) */ /* any later version. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* */ /* This code is still under development; expect some rough edges. */ /* */ /************************************************************************/ ═══ 4.3. Authors of the original Linux ext2 file system ═══ Parts of the ext2-os2 package are based on GNU GPL copyrighted code whose owners are :  Linus Torvalds, the main author of the Linux kernel.  Remy Card, the main author of the Linux ext2fs file system kernel code, as well as part of the ext2fs utilities.  Theodore Ts'o, the main author of the Linux ext2fs file system utilities.  Stephen Tweedie, who improved the Linux ext2fs allocation algorithms.  Werner Almesberger, the author of the Linux FAT file system.  Jean Loup Gailly, the author of gzip  ...probably many other contributors to the Linux kernel. ═══ 5. Installation instructions ═══ This chapter describes the installation and setup instructions Step 1 - Things to do BEFORE installing ext2-os2 Step 2 - Make OS/2 see your Linux ext2fs partitions Step 3 - Copying the files to your hard drive Step 4 - Using the ext2-os2 monitoring tool Step 5 - Specifying command line parameters ═══ 5.1. Step 1 - Things to do BEFORE installing ext2-os2 ═══ Here are things you must do before installing this version of ext2-os2 : 1. Please run e2fsck from Linux on ALL your ext2fs partitions BEFORE installing ext2-os2. (You might have to boot Linux from floppy to do this, especially to run e2fsck on your root partition). 2. I STRONGLY suggest you to first backup any data you don't want to loose BEFORE trying this driver. 3. Make a backup copy of your CONFIG.SYS 4. Have the two OS/2 kicker diskettes handy , with a full screen editor, so that you can restore your CONFIG.SYS if the system crashed at boot time. (This is not needed with WARP : Alt+F1 C at boot time will do the trick) 5. Prepare a Linux boot diskette, with e2fsck on it. 6. If you installed a previous version of ext2-os2, then comment out the following CONFIG.SYS statements and reboot your system to ensure that no ext2-os2 file is locked while installing the new version.  IFS = \ext2-os2.ifs  RUN = \ext2_lw.exe  BASEDEV = ext2flt.flt  BASEDEV = mwdd32.sys ═══ 5.2. Step 2 - Make OS/2 see your Linux ext2fs partitions ═══ This chapter describes how to make OS/2 see your Linux ext2fs partitions ═══ 5.2.1. Understanding how does OS/2 assign drive letters ═══ OS2DASD.DMD is the block device managing fixed partitionnable disks and floppies. It is always (as far as I know) the first block device loaded by the system. It first scans every .add drivers for physical disks. Then it reads the partition table of each disk. It first looks for active primary OS/2 partitions (Types 01, 04, 06 and 07) and installs a block device for each of them It repeats this for each physical drive in the system. Then it looks for extended volumes on the first physical drive (type 05 partition), reads the extended boot record, looks for an OS/2 partition and assign it a drive letter, looks for another extended volume ... and so on until no more extended volume is found on the first disk. It them repeats this for each physical drive. Example : ■ Scans all *.add driver for fixed disks - found 2 ■ Reads the MBR of physical disk 1 ■ Found an OS/2 type 7 partition (active primary OS/2 IFS) - Install a block device (C:) ■ Found an unknown type 0x83 partition - skip it ■ Found an OS/2 type 5 partition (extended volume) - skip it ■ No more primary partition ■ Reads the MBR of physical disk 2 ■ Found an OS/2 type 7 partition - Install a block device (D:) ■ Found an unknown type 17 (inactive primary OS/2 IFS) - skip it ■ Found an OS/2 type 5 partition (extended vol) - skip it ■ No more primary partition Now done for primary partitions - processing extended volumes ■ Reread the MBR of physical disk 1 ■ Found an OS/2 type 5 partition (extended volume) ■ Reads the extended boot record of the extended volume ■ Found a OS/2 type 7 partition - Install a block device (E:) ■ Found an OS/2 type 5 partition ■ Reads the extended boot record ■ Found a OS/2 type 7 partition - Install a block device (F:) ■ No more partition ■ Reread the MBR of physical disk 2 ■ Found an OS/2 type 5 partition (extended volume) ■ Reads the extended boot record of the extended volume ■ Found a OS/2 type 7 partition - Install a block device (G:) ■ No more partition Make OS/2 see your Linux ext2fs partitions ═══ 5.2.2. Make OS/2 see your Linux ext2fs partitions. ═══ During "normal" operations, OS/2 will not assign a drive letter to the Linux partitions, because their type (0x83) is not one of the types OS/2 normally recognize. An installable file system driver does not have any control on how block devices are assigned : this is a device driver issue. If we don't do anything, the ext2fs IFS won't be very useful, since OS/2 doesn't even call it (no block device allocated). In order for OS/2 to see your ext2fs partition, you must either change your Linux ext2fs partition ID from 0x83 (Linux native) to 0x7 (OS/2 IFS - and not OS/2 HPFS as stated in the Linux fdisk documentation), or make OS/2 think type 0x83 partitions are type 0x7 partitions. In the first case we must manually alter the partition table, and in the second case we must use a special filter device driver - ext2flt.flt - whose purpose is to show a "hacked" partition table to OS2DASD.DMD. Here's how ext2flt.flt works : A virtual fixed disk is created for each partition under control of the driver. These virtual fixed disks each contain one extended partition with a logical drive in it. Since OS2DASD.DMD that controls fixed disks first assigns drive letters to primary partitions the virtual partitions are tacked on at the end of allocated drive letters. (To control the mounting order of all partitions OS2DASD is prevented from directly accessing the fixed disks and the filter presents it with an alternate list of partitions.) BE CAREFUL : IF YOU DECIDE TO CHANGE PARTITION ID MANUALLY BE AWARE THAT IT CAN CHANGE YOUR DRIVE LETTERS AND MAKE OS/2 UNBOOTABLE !! Examples being better than a long speach, let's look at some different situations : Example 1 Example 2 Example 3 ═══ 5.3. Step 3 - Copying the files to your hard drive ═══  Installation using the "Device Driver Install" object  Manual installation ═══ 5.3.1. Installation using the "Device Driver Install" object ═══ 1. Open the "OS/2 System" folder 2. Open the "System Setup" folder 3. Open the "Device Driver Install" object a. Type in the "source directory" entry field the path where you decompacted the files b. Type in the "target directory" your OS/2 boot drive c. Click on the "Install..." push button d. Select the drivers to install (select both of them) :  "Linux ext2fs file system driver (IFS) version 2.40 for OS/2"  "ext2flt - Filter to make Linux partitions visable to OS/2." e. Click on OK 4. Add :\OS2\FS\EXT2 to the PATH and LIBPATH statements in your CONFIG.SYS 5. Set and/or change command line parameters for ext2-os2.ifs and ext2flt.flt. 6. Reboot your computer ═══ 5.3.2. Manual installation ═══ ext2flt installation 1. copy ext2flt.flt and ext2flt.sym in \OS2 or in \OS2\BOOT (WARP only) 2. add the following line in CONFIG.SYS BASEDEV=EXT2FLT.FLT 3. if necessary, adjust ext2flt command line parameters (for instance /W if you want write access) ext2-os2 installation 1. copy mwdd32.sys and mwdd32.sym in \OS2 or in \OS2\BOOT (WARP only) 2. add the following line in CONFIG.SYS BASEDEV=MWDD32.SYS 3. make a directory to hold ext2-os2 files somewhere but NOT on a Linux partition. 4. add this directory at the end of the PATH and LIBPATH statements in CONFIG.SYS 5. copy the following files to that directory :  ext2-os2.ifs  ext2-os2.exe  sync.exe  hardlink.exe  umount.exe  remount.exe  ext2_lw.exe  ext2-os2.inf  ext2-os2.htm  ext2-os2.sym  ext2-os2.ddp  vfsapi.dll  vfsapi.lib  uext2.dll  uuid.dll  et.dll  ext2fs.dll  badblks.exe  mke2fs.exe  e2fsck.exe 6. add the following lines in your CONFIG.SYS IFS=\ext2-os2.ifs -cache:256 -errors=continue RUN=\ext2_lw.exe 7. if necessary, adjust ext2-os2.ifs command line parameters (for instance -rw if you want write access) Note: In CONFIG.SYS, ext2-os2.ifs MUST be located AFTER the IFS managing the boot drive (HPFS.IFS usually). ext2-os2.ifs can appear at the head of CONFIG.SYS only if you boot OS/2 from a Linux partition. ═══ 5.4. Step 4 - Using the ext2-os2 monitoring tool ═══ ext2-os2.exe is a monitoring tool to retrieve data from ext2-os2.ifs. It is a PM notebook containing :  page 1 : disk cache information  page 2 : I-node and open file information  page 3 : ext2-os2.ifs standard output  page 4 : ext2-os2.ifs swapper information (active only when SWAPPER.DAT is located on a Linux ext2fs partition) ═══ 5.5. Step 5 - Specifying command line parameters ═══ ext2-os2.ifs command line in CONFIG.SYS : IFS = :\ext2-os2.ifs [-q] [-cache:] [-rw] [-no_auto_fsck] [-case_retensive] [-] [-no_strat2] [-errors=[panic|continue]] [-output=[com1|com2]] [-tz: